import {
  request
} from "@/utils/request";
import {
  getCurrentOrganizationId,
} from '@/utils/util.js'
// 获取已签订协议信息
export function getAgreeInfo(parameter) {
  return request({
    url: `/indv/v1/${getCurrentOrganizationId()}/user-idrecords?userId=${parameter}`,
    method: 'get'
  })
}
// 新增签订用户协议
export function addAgreeInfo(parameter) {
  return request({
    url: `/indv/v1/${getCurrentOrganizationId()}/user-idrecords`,
    method: 'post',
    data: parameter,
  })
}
//待办中心登录
export function loginForTodocenter(val,vals) {
  console.log(111,process)
  let str = "";
  process.env && process.env.NODE_ENV === 'production' ? str = vals : 'sanyplm';
  return request({
    url: `/oauth/public/v1/loginForTodocenter?systemCode=plm&encryData=${val}&signData=${str}&client_id=localhost&grant_type=implicit&response_type=token`,
    method: "get",
    data: {},
  });
}
//从待办中心过来获取任务基本信息
export function getWorkItemDataForMobile(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/foundation/workflow/getWorkItemDataForMobile',
    method: "post",
    data: parameter,
  });
}